package com.zxjbyte.yiyi.framework.web.event;

import com.google.common.eventbus.Subscribe;
import com.zxjbyte.yiyi.framework.common.core.eventbus.EventSubscriber;
import com.zxjbyte.yiyi.module.system.api.log.ErrorLogApi;
import lombok.RequiredArgsConstructor;

/**
 * @Author zhangxingjia
 * @Date 2023/3/17 21:33
 * @Version: 1.0
 */
@RequiredArgsConstructor
@EventSubscriber(async = true)
public class ErrorLogListener {

    private final ErrorLogApi errorLogApi;

    @Subscribe
    public void addErrorLog(ErrorLogAddEvent event) {
        errorLogApi.addErrorLog(event.getAddDto());
    }
}
